package dal

// GradeAlter 登记异动信息
type GradeAlter struct {
	GradeAlterID int64  `gorm:"primaryKey" json:"grade_alter_id"`
	StudentNum   string `gorm:"not null; type:varchar(10)" json:"studentNum"`
	Adder        string `gorm:"not null" json:"adder"`
	GradeBefore  string `gorm:"not null"  json:"grade_before"`
	GradeAfter   string `gorm:"not null" json:"grade_after"`
	AlterTime    string `gorm:"not null" json:"alter_time"`
	AlterSource  string `gorm:"not null" json:"alter_source"`
	AlterReason  string `gorm:"" json:"alter_reason"`
	Adjuster     string `gorm:"not null" json:"adjuster"`
}

func (s *GradeAlter) GetGradeAlter(num string) (GradeAlter, error) {
	var gradeAlter GradeAlter
	return gradeAlter, DB.Where("student_num = ?", num).First(&gradeAlter).Error
}
